<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>'readercenter.jsp'</title>

<script type="text/javascript">
	function mylist() {
	
	var url ="${pageContext.request.contextPath }/reader/ReaderListServlet";
	var method="post";
	var params="";
	var targetelement ="listdiv";
		var list = document.getElementById("listdiv");
		
		
		if (list.style.display != 'block') {
		    if(list.innerHTML.match("div")==null){      //判断listdiv中是否有内容了。来减少对数据库的查询请求
			toDoXHR(url,method,params,targetelement);
		    }
			list.style.display = 'block';
		}else{
			list.style.display = 'none';
		}
	}
</script>
<style type="text/css">
#listdiv {
	display: none;
}
</style>
<script type="text/javascript" src="${pageContext.request.contextPath }/JS/toDoXHR.js"></script></head>

<body>
	<div align="center">
		<a href="${pageContext.request.contextPath }">首页</a> <br />
		<c:if test="${whologin!=null}">欢迎读者---${whologin.nickname }</c:if>
	</div>
	<div>
		<table align="center">
			<tr>
				<td colspan="2">个人信息</td>
			</tr>
			<tr>
				<td>用户名</td>
				<td>${whologin.username }</td>
			</tr>
			<tr>
				<td>昵称</td>
				<td>${whologin.nickname }</td>
			</tr>
			<tr>
				<td>生日</td>
				<td>${whologin.birthday }</td>
			</tr>
			<tr>
				<td>小说收藏架</td>
				<td><input type="button" value="查看" onclick="mylist()">
				</td>
			</tr>
		</table>
	</div>
	<div id="listdiv" align="center"></div>

</body>
</html>
